﻿<div>
    <div class="pull-left">
        <h4>
            文章密码：
            <span class="text-info">{{ViewToken}}</span>
        </h4>
    </div>
    <div class="form-inline pull-right">
        <button class="btn btn-info waves-effect" ng-click="list.GetPageData(paginationConf.currentPage, paginationConf.itemsPerPage);">
            <span class="glyphicon glyphicon-refresh"></span>
        </button>
        <div class="input-group">
            <span class="input-group-addon">全局搜索：</span>
            <div class="fg-line">
                <input type="text" class="form-control" ng-change="search(kw)" ng-model="kw" placeholder="全局搜索" />
            </div>
        </div>
        <div class="input-group">
            <span class="input-group-addon">服务端排序方式：</span>
            <div class="ui selection dropdown orderby">
                <input name="gender" type="hidden" value="default">
                <i class="dropdown icon"></i>
                <div class="text">最后修改</div>
                <div class="menu">
                    <div class="item" data-value="0">发表时间</div>
                    <div class="item" data-value="1">最后修改</div>
                    <div class="item" data-value="2">访问量最多</div>
                    <div class="item" data-value="3">评论最多</div>
                    <div class="item" data-value="4">支持数最多</div>
                </div>
            </div>
        </div>
        <div class="input-group">
            <span class="input-group-addon">显示字段：</span>
            <div class="ui multiple search selection dropdown field">
                <input type="hidden" id="field">
                <i class="dropdown icon"></i>
                <div class="default text">选择字段</div>
                <div class="menu">
                    <div class="item" data-value="Author">作者</div>
                    <div class="item" data-value="Email">作者邮箱</div>
                    <div class="item" data-value="VoteUpCount">支持数</div>
                    <div class="item" data-value="VoteDownCount">反对数</div>
                    <div class="item" data-value="Status">状态</div>
                </div>
            </div>
        </div>
    </div>
    <table ng-table="list.tableParams" class="table table-bordered table-hover table-condensed editable-table listTable" ng-form="list.tableForm" disable-filter="list.isAdding" tracked-table="list.tableTracker">
        <tr ng-repeat="row in $data" ng-form="rowForm" tracked-table-row="row">
            <td title="'标题'" filter="{Title: 'text'}" sortable="'Title'">
                <a ng-href="/{{row.Id}}" target="_blank">{{row.Title}}</a>
            </td>
            <td title="'作者'" filter="{Author: 'text'}" sortable="'Author'" ng-if="Author">
                {{row.Author}}
            </td>
            <td title="'阅读'" filter="{ViewCount: 'number'}" sortable="'ViewCount'">
                {{row.ViewCount}}
            </td>
            <td title="'发表'" filter="{PostDate: 'text'}" sortable="'PostDate'">
                {{row.PostDate|date:'yyyy-MM-dd HH:mm:ss'}}
            </td>
            <td title="'修改'" filter="{ModifyDate: 'text'}" sortable="'ModifyDate'">
                {{row.ModifyDate|date:'yyyy-MM-dd HH:mm:ss'}}
            </td>
            <td title="'修改次数'" filter="{ModifyCount: 'text'}" sortable="'ModifyCount'">
                {{row.ModifyCount}}
            </td>
            <td title="'分类'" filter="{CategoryName: 'text'}" sortable="'CategoryName'">
                {{row.CategoryName}}
            </td>
            <td title="'作者邮箱'" filter="{Email: 'text'}" sortable="'Email'" ng-if="Email">
                {{row.Email}}
            </td>
            <td title="'标签'" filter="{Label: 'text'}" sortable="'Label'">
                {{row.Label}}
            </td>
            <td title="'支持'" filter="{VoteUpCount: 'number'}" sortable="'VoteUpCount'" ng-if="VoteUpCount">
                {{row.VoteUpCount}}
            </td>
            <td title="'反对'" filter="{VoteDownCount: 'number'}" sortable="'VoteDownCount'" ng-if="VoteDownCount">
                {{row.VoteDownCount}}
            </td>
            <td title="'状态'" filter="{Status: 'select'}" sortable="'Status'" filter-data="list.stats" ng-if="Status">
                {{row.Status}}
            </td>
            <td title="'操作'" style="width: 185px;">
                <div class="btn-group">
                    <button class="btn btn-default btn-sm waves-effect" ng-click="list.pass(row)" ng-if="row.Status=='审核中'">
                        <i class="icon-checkmark"></i>
                    </button>
                    <a class="btn btn-success btn-sm waves-effect" ng-href="#/post/edit?id={{row.Id}}">
                        <i class="icon-pencil"></i>
                    </a>
                    <button class="btn btn-danger btn-sm waves-effect" ng-click="list.del(row)" ng-if="row.Status!='已删除'">
                        <i class="icon-bin"></i>
                    </button>
                    <a class="btn btn-danger btn-sm waves-effect" ng-click="list.truncate(row)" ng-if="row.Status=='已删除'">
                        <i class="icon-cross"></i>
                    </a>
                    <a class="btn btn-info btn-sm waves-effect" ng-click="list.restore(row)" ng-if="row.Status=='已删除'">
                        <i class="icon-undo2"></i>
                    </a>
                    <a class="btn  btn-sm waves-effect" ng-class="{true:'btn-success',false:'btn-primary'}[row.IsFixedTop]" ng-click="list.fixtop(row.Id)">
                        <i class="icon-pushpin" ng-class="{true:'text-danger'}[row.IsFixedTop]"></i>
                    </a>
                </div>
            </td>
        </tr>
    </table>
    <tm-pagination conf="paginationConf"></tm-pagination>
</div>